package com.turing.post.datatranferpmbs.util;

import java.io.Serializable;
import java.math.BigInteger;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.IdClass;
import javax.persistence.Table;

/**
 * 实体表 -- Pmbs.MchTradDetail
 * 
 * @author 杨新斌
 * 
 * @version 1.0.0
 * @since 2009-08-31
 */
@SuppressWarnings("serial")
@Entity
@Table(name = "MchTradDetail")
@IdClass(PMBSMchTradDetail.class)
public class PMBSMchTradDetail implements Serializable {

	/**
	 * 商户号
	 */
	@Id
	@Column(name = "MerchantNo", nullable = false)
	private String MerchantNo;

	public String getMerchantNo() {
		return MerchantNo;
	}

	public void setMerchantNo(String merchantNo) {
		MerchantNo = merchantNo;
	}

	/**
	 * 帐务日期
	 */
	@Id
	@Column(name = "TranDate", nullable = false)
	private java.util.Date TranDate;

	public java.util.Date getTranDate() {
		return TranDate;
	}

	public void setTranDate(java.util.Date tranDate) {
		TranDate = tranDate;
	}

	/**
	 * 流水号
	 */
	@Id
	@Column(name = "TranSeqNo", nullable = false)
	private String TranSeqNo;

	public String getTranSeqNo() {
		return TranSeqNo;
	}

	public void setTranSeqNo(String tranSeqNo) {
		TranSeqNo = tranSeqNo;
	}

	/**
	 * 取消流水号
	 */
	@Column(name = "CancelTranSeqNo", nullable = true)
	private String CancelTranSeqNo;

	public String getCancelTranSeqNo() {
		return CancelTranSeqNo;
	}

	public void setCancelTranSeqNo(String cancelTranSeqNo) {
		CancelTranSeqNo = cancelTranSeqNo;
	}

	/**
	 * 卡支付
	 */
	public static final String TRANCODE_PAID = "1010";

	/**
	 * 卡支付取消
	 */
	public static final String TRANCODE_PAIDCANCEL = "1020";

	/**
	 * 卡支付冲正
	 */
	public static final String TRANCODE_PAIDCORR = "1021";

	/**
	 * 交易码
	 */
	@Column(name = "TranCode", nullable = false)
	private String TranCode;

	public String getTranCode() {
		return TranCode;
	}

	public void setTranCode(String tranCode) {
		TranCode = tranCode;
	}

	/**
	 * 交易时间
	 */
	@Column(name = "TradTime", nullable = false)
	private Date TradTime;

	public Date getTradTime() {
		return TradTime;
	}

	public void setTradTime(Date tradTime) {
		TradTime = tradTime;
	}

	/**
	 * 商户请求流水
	 */
	@Column(name = "MrchSeqNo", nullable = true)
	private String MrchSeqNo;

	public String getMrchSeqNo() {
		return MrchSeqNo;
	}

	public void setMrchSeqNo(String mrchSeqNo) {
		MrchSeqNo = mrchSeqNo;
	}

	/**
	 * 卡号
	 */
	@Column(name = "CardNo", nullable = true)
	private String CardNo;

	public String getCardNo() {
		return CardNo;
	}

	public void setCardNo(String cardNo) {
		CardNo = cardNo;
	}

	/**
	 * 交易金额
	 */
	@Column(name = "Amount", nullable = true)
	private Integer Amount;

	public Integer getAmount() {
		return Amount;
	}

	public void setAmount(Integer amount) {
		Amount = amount;
	}

	/**
	 * 积分支付额
	 */
	@Column(name = "ScorePaidAmount", nullable = true)
	private Integer ScorePaidAmount;

	public Integer getScorePaidAmount() {
		return ScorePaidAmount;
	}

	public void setScorePaidAmount(Integer scorePaidAmount) {
		ScorePaidAmount = scorePaidAmount;
	}

	/**
	 * 实际积分支付额
	 */
	@Column(name = "FactScorePaidAmount", nullable = true)
	private BigInteger FactScorePaidAmount;

	public BigInteger getFactScorePaidAmount() {
		return FactScorePaidAmount;
	}

	public void setFactScorePaidAmount(BigInteger factScorePaidAmount) {
		FactScorePaidAmount = factScorePaidAmount;
	}

	/**
	 * 商户余额
	 */
	@Column(name = "Balance", nullable = true)
	private BigInteger Balance;

	public BigInteger getBalance() {
		return Balance;
	}

	public void setBalance(BigInteger balance) {
		Balance = balance;
	}

	/**
	 * 卡系统请求流水号
	 */
	@Column(name = "CardReqSeqNo", nullable = true)
	private String CardReqSeqNo;

	public String getCardReqSeqNo() {
		return CardReqSeqNo;
	}

	public void setCardReqSeqNo(String cardReqSeqNo) {
		CardReqSeqNo = cardReqSeqNo;
	}

	/**
	 * 卡系统应答流水号
	 */
	@Column(name = "CardAckSeqNo", nullable = true)
	private String CardAckSeqNo;

	public String getCardAckSeqNo() {
		return CardAckSeqNo;
	}

	public void setCardAckSeqNo(String cardAckSeqNo) {
		CardAckSeqNo = cardAckSeqNo;
	}

	/**
	 * 卡系统交易成功
	 */
	public static final String STATUS_SUCC = "0";

	/**
	 * 已向卡系统发出交易
	 */
	public static final String STATUS_ALREADY_ISSUE_CARD = "1";

	/**
	 * 已自动支付取消成功
	 */
	public static final String STATUS_CARD_PAID_CANCEL_SUCC = "2";

	/**
	 * 已向卡系统发出支付取消请求
	 */
	public static final String STATUS_ISSUE_CARD_PAID_CANCEL = "3";

	/**
	 * 流水状态
	 */
	@Column(name = "Status", nullable = true)
	private String Status;

	public String getStatus() {
		return Status;
	}

	public void setStatus(String status) {
		Status = status;
	}

	/**
	 * 商户业务摘要
	 */
	@Column(name = "MrchAbstract", nullable = true)
	private String MrchAbstract;

	public String getMrchAbstract() {
		return MrchAbstract;
	}

	public void setMrchAbstract(String mrchAbstract) {
		MrchAbstract = mrchAbstract;
	}

	/**
	 * 卡张数 -- 该字段从表中删除(2011.01.13)
	 */
	/*
	 * @Column(name = "CardNum", nullable = true) private String CardNum;
	 * 
	 * public String getCardNum() { return CardNum; }
	 * 
	 * public void setCardNum(String cardNum) { CardNum = cardNum; }
	 */
	/**
	 * 会员ID
	 */
	@Column(name = "MembershipId", nullable = true)
	private BigInteger MembershipId;

	public BigInteger getMembershipId() {
		return MembershipId;
	}

	public void setMembershipId(BigInteger membershipId) {
		MembershipId = membershipId;
	}

	/**
	 * 会员卡卡号
	 */
	@Column(name = "VipCardNo", nullable = true)
	private String VipCardNo;

	public String getVipCardNo() {
		return VipCardNo;
	}

	public void setVipCardNo(String vipCardNo) {
		VipCardNo = vipCardNo;
	}

	/**
	 * 积分产生流水号
	 */
	@Column(name = "ScoreTranSeqNo", nullable = true)
	private String ScoreTranSeqNo;

	public String getScoreTranSeqNo() {
		return ScoreTranSeqNo;
	}

	public void setScoreTranSeqNo(String scoreTranSeqNo) {
		ScoreTranSeqNo = scoreTranSeqNo;
	}

	/**
	 * 积分支付流水号
	 */
	@Column(name = "ScorePaidTranSeqNo", nullable = true)
	private String ScorePaidTranSeqNo;

	public String getScorePaidTranSeqNo() {
		return ScorePaidTranSeqNo;
	}

	public void setScorePaidTranSeqNo(String scorePaidTranSeqNo) {
		ScorePaidTranSeqNo = scorePaidTranSeqNo;
	}

	/**
	 * 渠道积分余额
	 */
	@Column(name = "Score", nullable = true)
	private BigInteger Score;

	public BigInteger getScore() {
		return Score;
	}

	public void setScore(BigInteger score) {
		Score = score;
	}

	/**
	 * 本次积分发生额
	 */
	@Column(name = "ScoreAmount", nullable = true)
	private BigInteger ScoreAmount;

	public BigInteger getScoreAmount() {
		return ScoreAmount;
	}

	public void setScoreAmount(BigInteger scoreAmount) {
		ScoreAmount = scoreAmount;
	}

	/**
	 * 退货/被退货交易日期
	 */
	@Column(name = "OtherTranDate", nullable = true)
	private Date OtherTranDate;

	public Date getOtherTranDate() {
		return OtherTranDate;
	}

	public void setOtherTranDate(Date otherTranDate) {
		OtherTranDate = otherTranDate;
	}

	/**
	 * 退货/被退货交易流水
	 */
	@Column(name = "OtherTranSeqNo", nullable = true)
	private String OtherTranSeqNo;

	public String getOtherTranSeqNo() {
		return OtherTranSeqNo;
	}

	public void setOtherTranSeqNo(String otherTranSeqNo) {
		OtherTranSeqNo = otherTranSeqNo;
	}

	/**
	 * 原支付交易商户流水号
	 */
	@Column(name = "OtherMrchSeqNo", nullable = true)
	private String OtherMrchSeqNo;

	public String getOtherMrchSeqNo() {
		return OtherMrchSeqNo;
	}

	public void setOtherMrchSeqNo(String otherMrchSeqNo) {
		OtherMrchSeqNo = otherMrchSeqNo;
	}

	/**
	 * 积分补登时间
	 */
	@Column(name = "ReScoreTime", nullable = true)
	private Date ReScoreTime;

	public Date getReScoreTime() {
		return ReScoreTime;
	}

	public void setReScoreTime(Date reScoreTime) {
		ReScoreTime = reScoreTime;
	}

	/**
	 * 积分补登操作员
	 */
	@Column(name = "ReScoreOperNo", nullable = true)
	private String ReScoreOperNo;

	public String getReScoreOperNo() {
		return ReScoreOperNo;
	}

	public void setReScoreOperNo(String reScoreOperNo) {
		ReScoreOperNo = reScoreOperNo;
	}

	/**
	 * 积分补登备注
	 */
	@Column(name = "ReScoreRemark", nullable = true)
	private String ReScoreRemark;

	public String getReScoreRemark() {
		return ReScoreRemark;
	}

	public void setReScoreRemark(String reScoreRemark) {
		ReScoreRemark = reScoreRemark;
	}

	public boolean equals(Object obj) {
		if (obj == this)
			return true;

		if (!(obj instanceof PMBSMchTradDetail))
			return false;

		PMBSMchTradDetail pk = (PMBSMchTradDetail) obj;

		if (!MerchantNo.equals(pk.getMerchantNo()))
			return false;

		if (!TranDate.equals(pk.getTranDate()))
			return false;

		if (!TranSeqNo.equals(pk.getTranSeqNo()))
			return false;

		return true;
	}

	public int hashCode() {
		return MerchantNo.hashCode() + TranDate.hashCode()
				+ TranSeqNo.hashCode();
	}

	/**
	 * Default constructor.
	 */
	public PMBSMchTradDetail() {
		super();
	}

}